﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using DotNetUniLodz.HelperClasses;
using HashLib;
using System.Web.Security;

namespace DotNetUniLodz.Tests
{
    [TestClass]
    public class RoleProviderTests
    {
        [TestMethod]
        public void TestIsUserInRoleAdmin()
        {
            RoleProvider provider = new MyRoleProvider();
            string userName = "Wojtek.Sipa";
            string roleName = "Admin";
            bool actual = provider.IsUserInRole(userName, roleName);
            Assert.AreEqual(true, actual);
        }

        [TestMethod]
        public void TestIsUserInRoleAdminFake()
        {
            RoleProvider provider = new MyRoleProvider();
            string userName = "_____123_takiegomaNiebyc!";
            string roleName = "Admin";
            bool actual = provider.IsUserInRole(userName, roleName);
            Assert.AreEqual(false, actual);
        }
    }
}
